#pragma once


#include "Containers/Vector.h"
#include "Containers/String.h"
#include "Containers/Optional.h"
#include "EditorScriptToken.h"

struct SEditorTokenGenerateResult
{
    TVector<SEditorScriptToken> TokenList;

    TVector<SEditorScriptErrorMessage> Errors;

};

struct SEditorScriptTokenGenerator
{
public:
    SEditorScriptTokenGenerator(const CString& InScriptContent);

    SEditorTokenGenerateResult GenerateTokens();

protected:
    CString ScriptContent;
    int64_t CurrentCharIndex=-1;
    SEditorTokenGenerateResult Result;
    //return false if reach the end of the file
    bool GotoNextChar();
    void Skip(int64_t Count);
    char32_t GetCurrentChar() const;
    TOptional<char32_t> GetNextChar() const;

    void GenerateOneToken();
};

